﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace WCLOnlineExam.Models
{
    public class Question : EntityBase 
    {
        [Display(Name = "题目", Order = 10)]
        [Searchable]
        [Required]
        public virtual string Title{ get; set; }

        [Searchable]
        [Display(Name = "A",Order = 10)]
        [Required]
        public virtual string FirstOption { get; set; }

        [Display(Name = "B", Order = 10)]
        [Required]
        public virtual string SecondOption { get; set; }

        [Display(Name = "C", Order = 10)]
        [Required]
        public virtual string ThirdOption { get; set; }

        [Display(Name = "D", Order = 10)]
        [Required]
        public virtual string ForthOption { get; set; }

        [Display(Name = "正确答案", Order = 30)]
        [Required]
        public virtual Answer Answer { get; set; }

        public override string ToString()
        {
            return Title;
        }

        [Hide]
        public virtual ICollection<Exam> Exams { get; set; }

    }

    public enum Answer
    {
        A = 0,
        B = 1,
        C = 2,
        D = 3
    }

}